package com.guigu.userservice.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.guigu.userservice.entity.StatisticsData;
import com.guigu.userservice.mapper.StatisticsDataMapper;
import com.guigu.userservice.service.StatisticsDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StatisticsDataServiceImpl extends ServiceImpl<StatisticsDataMapper, StatisticsData> implements StatisticsDataService {
    @Autowired
    private StatisticsDataMapper statisticsMapper;

    public StatisticsData getTodayStatistics() {
        StatisticsData data = new StatisticsData();

        data.setNewMembers(statisticsMapper.getTodayNewMembers());
        data.setPaidOrders(statisticsMapper.getTodayPaidOrders());
        data.setPaidAmount(statisticsMapper.getTodayPaidAmount());

        return data;
    }
}
